VERSION 5.00
Object = "{CDE57A40-8B86-11D0-B3C6-00A0C90AEA82}#1.0#0"; "MSDATGRD.OCX"
Begin VB.Form frmTechnic 
   Caption         =   "Technic"
   ClientHeight    =   6870
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   14580
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   6870
   ScaleWidth      =   14580
   Begin VB.CommandButton cmdClose 
      Caption         =   "Close"
      Height          =   615
      Left            =   14640
      TabIndex        =   9
      Top             =   6600
      Width           =   3975
   End
   Begin VB.CommandButton cmdLogout 
      Caption         =   "Logout"
      Height          =   615
      Left            =   17160
      TabIndex        =   8
      Top             =   5760
      Width           =   1455
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "OK"
      Enabled         =   0   'False
      Height          =   615
      Left            =   14760
      TabIndex        =   7
      Top             =   5760
      Width           =   1455
   End
   Begin VB.TextBox txtComments 
      Height          =   3015
      Left            =   14760
      MultiLine       =   -1  'True
      TabIndex        =   6
      Top             =   2400
      Width           =   3855
   End
   Begin VB.ComboBox comResolution 
      Enabled         =   0   'False
      Height          =   315
      Left            =   16080
      TabIndex        =   4
      Text            =   "Select resolution"
      Top             =   960
      Width           =   2535
   End
   Begin VB.ComboBox comID 
      Height          =   315
      Left            =   16080
      TabIndex        =   2
      Text            =   "Select an incidence"
      Top             =   240
      Width           =   2535
   End
   Begin MSDataGridLib.DataGrid dgMyIncidences 
      Height          =   9015
      Left            =   0
      TabIndex        =   0
      Top             =   0
      Width           =   14295
      _ExtentX        =   25215
      _ExtentY        =   15901
      _Version        =   393216
      HeadLines       =   1
      RowHeight       =   15
      BeginProperty HeadFont {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
         Name            =   "MS Sans Serif"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ColumnCount     =   2
      BeginProperty Column00 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   3082
            SubFormatType   =   0
         EndProperty
      EndProperty
      BeginProperty Column01 
         DataField       =   ""
         Caption         =   ""
         BeginProperty DataFormat {6D835690-900B-11D0-9484-00A0C91110ED} 
            Type            =   0
            Format          =   ""
            HaveTrueFalseNull=   0
            FirstDayOfWeek  =   0
            FirstWeekOfYear =   0
            LCID            =   3082
            SubFormatType   =   0
         EndProperty
      EndProperty
      SplitCount      =   1
      BeginProperty Split0 
         BeginProperty Column00 
         EndProperty
         BeginProperty Column01 
         EndProperty
      EndProperty
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      Caption         =   "Comments"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   14760
      TabIndex        =   5
      Top             =   1680
      Width           =   1395
   End
   Begin VB.Label lblClear 
      AutoSize        =   -1  'True
      Caption         =   "Clear as"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   14760
      TabIndex        =   3
      Top             =   960
      Width           =   1050
   End
   Begin VB.Label lblID 
      AutoSize        =   -1  'True
      Caption         =   "ID"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   14.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   330
      Left            =   14760
      TabIndex        =   1
      Top             =   240
      Width           =   300
   End
End
Attribute VB_Name = "frmTechnic"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmdClose_Click()
    End
End Sub

Private Sub cmdLogout_Click()
    Me.Hide
End Sub

Private Sub cmdOK_Click()
    If Me.comResolution.Text = "Fixed" Then
        resolution = "Closed"
    Else
        resolution = "Opened"
    End If
    Dim connector As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    connector.CursorLocation = adUseClient
    connector.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
    & "SERVER=127.0.0.1;" _
    & "DATABASE=incidences;" _
    & "UID=root;" _
    & "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384
    connector.Open
    rs.ActiveConnection = connector
    rs.CursorType = adOpenDynamic
    rs.CursorLocation = adUseClient
    rs.LockType = adLockOptimistic
    rs.Open ("update incidences set Status='" & resolution & "', Coments='" & Me.txtComments.Text & "' where ID_Incidence=" & Me.comID.Text)
    Me.txtComments.Text = ""
    MsgBox ("Cleared incidence")
End Sub

Private Sub comID_Click()
    Me.comResolution.Enabled = True
End Sub

Private Sub comResolution_Click()
    Me.cmdOK.Enabled = True
    Dim resolution As String
End Sub

Private Sub Form_Load()
    Me.Caption = Me.Caption & " interface: Loged as " & frmLogin.txtLogin.Text
    Dim connector As New ADODB.Connection
    Dim rs As New ADODB.Recordset
    Dim rs2 As New ADODB.Recordset
    connector.CursorLocation = adUseClient
    connector.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
    & "SERVER=127.0.0.1;" _
    & "DATABASE=incidences;" _
    & "UID=root;" _
    & "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384
    connector.Open
    rs.ActiveConnection = connector
    rs.CursorType = adOpenDynamic
    rs.CursorLocation = adUseClient
    rs.LockType = adLockOptimistic
    rs2.ActiveConnection = connector
    rs2.CursorType = adOpenDynamic
    rs2.CursorLocation = adUseClient
    rs2.LockType = adLockOptimistic
    rs.Open ("select * from incidences where Technic='" & frmLogin.txtLogin.Text & "' order by Priority")
    Set Me.dgMyIncidences.DataSource = rs
    rs2.Open ("select ID_Incidence from incidences where Technic='" & frmLogin.txtLogin.Text & "' and Status='Assigned'")
    While Not rs2.EOF
        Me.comID.AddItem (rs2.Fields(0).Value)
        rs2.MoveNext
    Wend
    Me.comResolution.AddItem ("Fixed")
    Me.comResolution.AddItem ("Unable to fix")
End Sub

